﻿//////////////////////////////////////////////////////////////////////////////
//
//  Copyright © 1998-2024 Glodon Company Limited.  All rights reserved.
//
//  Use of this software is subject to the terms of the Glodon license
//  agreement provided at the time of installation or download, or which
//  otherwise accompanies this software in either electronic or hard copy form.  
//
//////////////////////////////////////////////////////////////////////////////

#pragma once
#include "GmFamilyService.h"
#include "IFamilyGeneralForm.h"

namespace gfam
{

    class IFamily2DSketchCurve;
    class IFamily2DSketchLine;
    class IFamilySketch;

    /// \brief 放样融合体
    /// 放样融合体：由不同形状的轮廓1和轮廓2，沿着给定路径放样组成的体，截面垂直于路径
    ///  1. 轮廓线由直线和圆弧组成；
    ///  2. 轮廓线的只能有一个环；
    ///  3. 路径只有一条曲线；
    class GM_FAMILY_SERVICE_EXPORT IFamilySweptLoft : public IFamilyGeneralForm
    {
        DEFINE_CAST_DERIVED(gfam::IFamilySweptLoft, gfam::IFamilyGeneralForm)

    public:
        /// \brief 创建放样融合体
        /// 
        /// \param pDocument 文档
        /// \param profileSketch1Id 轮廓1草图id
        /// \param profileSketch2Id 轮廓2草图id
        /// \param pathSketchId 路径草图
        /// \return 放样融合体
        static IFamilySweptLoft* Create(gcmp::IDocument* pDocument, const gcmp::ElementId& profileSketch1Id, const gcmp::ElementId& profileSketch2Id, const gcmp::ElementId& pathSketchId);


        /// \brief 获取轮廓1草图id
        /// 
        /// \return 轮廓1草图id
        virtual gcmp::ElementId GetProfileSketch1Id() const = 0;

        /// \brief 设置轮廓1草图id
        /// 
        /// \param 草图id
        virtual void SetProfileSketch1Id(const gcmp::ElementId& id) = 0;

        /// \brief 获取轮廓1草图
        /// 
        /// \return 轮廓1草图
        virtual IFamilySketch2D*  GetProfileSketch1FW() = 0;

        /// \brief 获取轮廓1草图
        /// 
        /// \return 轮廓1草图
        virtual const IFamilySketch2D*  GetProfileSketch1() const = 0;

 
        /// \brief 获取轮廓2草图id
        /// 
        /// \return 轮廓2草图id
        virtual gcmp::ElementId GetProfileSketch2Id() const = 0;

        /// \brief 设置轮廓2草图id
        /// 
        /// \param 草图id
        virtual void SetProfileSketch2Id(const gcmp::ElementId& id) = 0;

        /// \brief 获取轮廓2草图
        /// 
        /// \return 轮廓2草图
        virtual IFamilySketch2D*  GetProfileSketch2FW() = 0;

        /// \brief 获取轮廓2草图
        /// 
        /// \return 轮廓2草图
        virtual const IFamilySketch2D*  GetProfileSketch2()const = 0;

        /// \brief 获取路径草图id
        /// 
        /// \return 路径草图id
        virtual gcmp::ElementId GetPathSketchId() const = 0;

        /// \brief 设置路径草图id
        /// 
        /// \param 草图id
        virtual void SetPathSketchId(const gcmp::ElementId& id) = 0;

        /// \brief 获取路径草图
        /// 
        /// \return 路径草图
        virtual IFamilySketch* GetPathSketchFW() = 0;

        /// \brief 获取路径草图
        /// 
        /// \return 路径草图
        virtual const IFamilySketch* GetPathSketch() const = 0;

        /// \brief 获取是否在编辑放样融合体
        /// 
        /// \return 是否在编辑放样融合体
        virtual bool GetIsEditingSweptLoft() const = 0;

        /// \brief 设置是否在编辑放样融合体
        /// 
        /// \param bIsEditingSweptLoft 编辑放样融合体布尔标记 
        virtual void SetIsEditingSweptLoft(bool bIsEditingSweptLoft) = 0;


        /// \brief 计算轮廓坐标系 
        /// 
        /// \param coordProfilePlane 保存计算的坐标系
        /// \param isStart true代表底面草图， fasle 代表顶面草图
        /// \return 操作成功返回true,否则返回false
        virtual bool ComputeProfilePlane(gcmp::Coordinate3d& coordProfilePlane, bool isStart) const = 0;


        /// \brief 设置底面轮廓族实例id
        /// 
        /// \param id 族实例id
        /// \return 操作成功返回true,否则返回false
        virtual bool SetInstanceIdOfProfileFamily1(const gcmp::ElementId& id) = 0;

        /// \brief 设置顶面轮廓族实例id
        /// 
        /// \param id 族实例id
        /// \return 操作成功返回true,否则返回false
        virtual bool SetInstanceIdOfProfileFamily2(const gcmp::ElementId& id) = 0;

        /// \brief 获取底面轮廓族实例id
        /// 
        /// \return 轮廓族实例id
        virtual gcmp::ElementId GetInstanceIdOfProfileFamily1() const = 0;

        /// \brief 获取顶面轮廓族实例id
        /// 
        /// \return 轮廓族实例id
        virtual gcmp::ElementId GetInstanceIdOfProfileFamily2() const = 0;

        /// \brief 获取轮廓族实例
        /// 
        /// \return 轮廓族实例
        virtual gcmp::IElement*  GetProfileFamilyInstance1() = 0;

        /// \brief 获取轮廓族实例
        /// 
        /// \return 轮廓族实例
        virtual const gcmp::IElement* GetProfileFamilyInstance1()const = 0;
        /// \brief 获取轮廓族实例
        /// 
        /// \return 轮廓族实例
        virtual gcmp::IElement*  GetProfileFamilyInstance2() = 0;

        /// \brief 获取轮廓族实例
        /// 
        /// \return 轮廓族实例
        virtual const gcmp::IElement* GetProfileFamilyInstance2()const = 0;

    };

}
